package com.zc.timedown.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * ClassName:OrderStatusEnum
 * Description:
 * DateTime: 2025/11/6 16:03
 * Author: zc
 * Version: 1.0
 */

@Getter
@AllArgsConstructor
public enum OrderStatusEnum {
    WAITING_PAYMENT(0, "待付款"),
    WAITING_DELIVERY(1, "待发货"),
    WAITING_RECEIVE(2, "待收货"),
    FINISHED(3, "已完成"),
    CANCELED(4, "已取消"),
    REFUNDING(5, "退款中"),
    REFUNDED(6, "已退款");

    private final Integer code;
    private final String message;

    public static String getMessageByCode(Integer code) {
        for (OrderStatusEnum value : OrderStatusEnum.values()) {
            if (value.code.equals(code)) {
                return value.message;
            }
        }
        return null;
    }
}
